package com.eastdigit.data;

public class PagedDataTable {

    private DataTable dataTable;
    private int totalRows;
    private int pageIndex;
    private int pageSize;
    private String nextFlag = "N";

    public DataTable getDataTable() {
        return dataTable;
    }

    public void setDataTable(DataTable dataTable) {
        this.dataTable = dataTable;
    }

    public int getTotalRows() {
        return totalRows;
    }

    public void setTotalRows(int totalRows) {
        this.totalRows = totalRows;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getNextFlag() {
        return totalRows > (pageIndex + 1) * pageSize ? "Y" : "N";
    }

    public boolean hasNext() {
        return "Y".equals(this.getNextFlag());
    }
}
